package com.orie.librarybase.utils;


import com.orie.librarybase.net.HttpConfig;

/**
 * Author : YLM
 * Time : 2018\8\23 0023
 * Description : 格式化图片路径
 */
public class HttpImage {
    public static String FormatImagePath(String imagePath) {
        if (imagePath.indexOf("https://") != -1) {
            return imagePath;
        } else if (imagePath.indexOf("http://") != -1) {
            return imagePath;
        } else {
            return HttpConfig.IMAGE + imagePath;
        }
    }

    public static String replace_https(String imagePath) {

        if (imagePath.indexOf("https://") != -1) {
            imagePath = imagePath.replaceFirst("https://", "http://");
            return imagePath;
        } else {
            return imagePath;
        }

    }
}
